/**
 * Description:
 * Class Name:_6_2_1_打印对象和toString方法
 * Date:2022/1/27 9:16
 *
 * @author LTisme
 * @version JAVA17
 */
package 疯狂Java讲义.第6章_面向对象_下._6_2_处理对象;

class Person{
    private String name;
    public Person(String name){
        this.name = name;
    }
}

public class PrintObject {
    public static void main(String[] args) {
        // 创建一个Person对象，将之赋给p变量
        var p = new Person("孙悟空");

        System.out.println(p.toString());
    }
}
